<template>
  <div>
    <div class="common-page page-work-order" v-loading.fullscreen="loading" v-if="order">
      <div class="common-page__head">
        <div class="title">
          <span class="text" style="color:#fff">{{ order.title }}</span>
          <span class="flagd" v-for="tag in order.tags" :key="tag.id">{{ tag.name }}</span>
        </div>
        <!-- <div class="title" v-else></div> -->
      </div>
      <div class="common-page__body common-form" style="display: flex;z-index:999999;">
        <div class="rows" style="flex: 3 1 0; padding-right: 0">
          <div class="row row--head">
            <div class="named">基本信息</div>
          </div>
          <div class="row row--3x">
            <div class="named">
              <span v-if="order.company.type === 'company'">企业</span>
              <span v-else-if="order.company.type === 'project'">项目</span>
              <span v-else-if="order.company.type === 'area'">园区</span>
              <span>名称</span>
            </div>
            <div class="valued">{{ order.company.name }}</div>
          </div>
          <div class="row row--3x">
            <div class="named">事项标题</div>
            <div class="valued">{{ order.title }}</div>
          </div>
          <div class="row row--3x">
            <div class="named">调研服务小组：</div>
            <div class="valued">{{ order.fwxz }}</div>
          </div>
          <div class="row row--3x">
            <div class="named">事项描述</div>
            <div class="valued" style="white-space: pre-wrap">{{ order.content }}</div>
          </div>
          <div class="row row--3x">
            <div class="named">事项附件</div>
            <div class="valued">
              <div style="padding: 1px 0">
                <comp-files-viewer :files="order.files" v-if="order.files.length > 0"></comp-files-viewer>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="named">事项分类</div>
            <div class="valued">
              <span class="text" v-for="tag in order.tags" :key="tag.id">{{ tag.name }}</span>
            </div>
          </div>
          <div class="row">
            <div class="named">事项层面</div>

            <div class="valued">
              <div v-if="order.level == 1 ">县级</div>
              <div v-else-if="order.level == 2 ">市级</div>
              <div v-else-if="order.level == 3 ">自治区级</div>
              <div v-else>
                <span v-if="order.dept.county.id">县级</span>
                <span v-else-if="order.dept.city.id">市级</span>
                <span v-else-if="order.dept.province.id">自治区级</span>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="named">事项状态</div>
            <div class="valued">
              <span class="el-status--info" v-if="order.status === 'created'"></span>
              <span class="el-status--danger"
                    v-else-if="order.status === 'published' || order.status === 'return'"></span>
              <span class="el-status--warning" v-else-if="order.status === 'handling'"></span>
              <span class="el-status--success" v-else-if="order.status === 'finished'"></span>
              <span>{{ order.statusText }}</span>
            </div>
          </div>
          <div class="row row--2x">
            <div class="named">提交人</div>
            <div class="valued">
              <span>{{ order.creator.name }}</span>
              <span style="margin-left: 0.5em; color: #aaa">{{ order.creator.number }}</span>
            </div>
          </div>
          <div class="row">
            <div class="named">提交时间</div>
            <div class="valued">{{ order.createdAt }}</div>
          </div>

          <div class="row">
            <div class="named">服务专员</div>
            <div class="valued">
              <span>{{ order.handler.name }}</span>
              <span style="margin-left: 0.5em; color: #aaa">{{ order.handler.number }}</span>
            </div>
          </div>
          <div class="row">
            <div class="named">办结时间</div>
            <div class="valued">
              <span>{{ order.finishedAt }}</span>
            </div>
          </div>
          <div class="row">
            <div class="named">评价人</div>
            <div class="valued">
              <span>{{ order.evaluatedCreator.name }}</span>
              <span style="margin-left: 0.5em; color: #aaa">{{ order.evaluatedCreator.number }}</span>
            </div>
          </div>
          <div class="row">
            <div class="named">评价打分</div>
            <div class="valued">
              <span v-if="order.evaluated === 'yes'">{{ order.evaluatedStars }}星</span>
            </div>
          </div>
          <div class="row">
            <div class="named">评价内容</div>
            <div class="valued">
              <span v-if="order.evaluated === 'yes'">{{ order.evaluatedContent }}</span>
            </div>
          </div>
        </div>
        <div class="rows" style="flex: 2 1 0; flex-wrap: nowrap; flex-direction: column; padding-right: 0">
          <div class="row row--head">
            <div class="named">处理过程信息</div>
            <div class="valued"></div>
          </div>
          <div class="row row--3x" style="flex: 1 1 0; overflow-x: hidden; overflow-y: auto">
            <div class="value">
              <trackscp :order="order"></trackscp>
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>
</template>
<script>
import user from "../../plugins/user"
import trackscp from "../../comps/order-trackscp.vue";

import {string, int} from "../../util";

export default {
  name: "foue",
  props: {
    orderId: {
      type: String,
      default: "",
    },
  },
  data: () => ({
    loading: false,
    cityId: "",
    cityList: [],
    xiangqingList: [],
    open: false,
    countryList: [],
    areaId: null,
    status: null,
    oopenfa: true,
    order: null,
  }),
  components: {
    trackscp
  },
  watch:{
    orderId:function(val){
      console.log('去查询order信息')
      this.getOrder()
    }
  },
  methods: {
    getOrder(){
      if(!this.orderId){
        return
      }
      this.loading = true;
      this.order = null
      user.getOrder(this.orderId).then((res) => {
        this.loading = false;
        if (res.code === 0) {
          this.order =res.data
        } else {

        }
      });
    }
  },
  mounted() {
    this.getOrder()
  }
}
</script>

<style lang="scss" scoped>
@import '../../common/common.css';

h3 {
  color: white;
  font-size: 48px;
  text-align: center;
  height: 60px;
  line-height: 60px;
}

.qq {
  color: rgb(86, 229, 86) !important;
}

.ww {
  color: yellow !important;
}

.ee {
  color: #f52929 !important;
}

.common-page__head {
  margin: 0;
}

.common-page__body {
  height: 73.5vh;

  .fixed {
    width: 100%;
    // overflow-y: auto;

  }

  .row {
    width: 100%;
    // background: red;
    color: white;

    .col {
      background-color: rgba(0, 24, 106, 0.5);
      color: white;
      line-height: 30px;

    }
  }

}

.pagecoun {
  height: 68vh;
  overflow-y: auto;

  .TableLis {
    .tabloading {
      position: relative;
      left: 45%;
      width: 200px;
      height: 200px;
      font-size: 20px;
      line-height: 200px;
      color: white;
      text-align: center;
    }

    .tali ::v-deep .el-table__row {
      background-color: #0C1E5E;

      color: white;
    }

    .tali ::v-deep tr:hover > td {
      background-color: #1808c3;
    }
  }
}


.page-work-order {
  overflow: hidden;
  height: 70vh;
}


</style>
